package com.huiminpay.merchant.common.oss;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 有点儿意思
 * @Description:
 */
@Configuration
public class OssConfig {

    @Value("${oss.aliyun.endpoint}")
    String endpoint;
    @Value("${oss.aliyun.accessKeyId}")
    String accessKeyId;
    @Value("${oss.aliyun.accessKeySecret}")
    String accessKeySecret;

        /**
         * 阿里云OSS
         * @return
         */
        @Bean
        public OSS oss(){
            return new OSSClientBuilder().build(endpoint,accessKeyId,accessKeySecret);
        }
    }

